The Commodore VIC20, released in 1981, was the first home computer to sell more than a million units.
Both sound and video are handled by the 6560 Video Interface Chip (VIC). This differs from the Commodore 64 which has a separate chip for each.
VIC 20 audio
global volume
1 bass square channel
1 alto square channel
1 soprano square channel
1 noise channel
Each voice has a tonal range of about 38 notes.
Output Frequency = Clock / (127 - X)
Clock values --
Bass ($900a|36874) NTSC:3995 | PAL:4329
Alto ($900b|36875) NTSC:7990 | PAL:8659
Soprano ($900c|36876) NTSC:15980 | PAL:17320
Noise ($900d|36877) NTSC:31960 | PAL:34640
This crude algorithm built into the VIC chip causes the scales to be slightly out of tune which is what gives the VIC it's unique 'dusty, old piano' sound. The 8th bit (value:128) of each voice's memory register is the ON/OFF bit leaving the remaining 7 bits to determine pitch.
See also